#define  _CRT_SECURE_NO_WARNINGS
class Solution {
    int hammingWeight(int n) {
        int count = 0;
        while (n) count++, n &= (n - 1);
        return count;
    }
public:
    int hammingDistance(int x, int y) {
        return hammingWeight(x ^ y);
    }
};